<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
    <style>

        div {
  
           width: 200px;
  
           height: 200px;
  
        }
  
  </style>
</head>

<body>
    <div id="app">
        <div id="hook-arguments-example" v-demo-directive:lightgrey= "message"> </div>
    </div> 
    <script>
        
       
 Vue.directive('demoDirective', {
bind: function (el,binding, vnode) {
el.style.color= '#fff'
el.style.backgroundColor=binding.arg
el.innerHTML =
'指令名name-'+ binding.name+'<br>' +
'指令绑定值value-'+ binding.value+'<br>' +
'指令绑定表达式expression-'+binding.expression+'<br>'+
'传入指令的参数argument-'+ binding.arg +'<br>'
}
 })


        var vm=new Vue({
           el:'#hook-arguments-example',
           data:{
               message:'你好，欢迎加入vue！'
           },
           methods:{}
        });
    </script>
</body>

</html>